package service.impl;

import dao.OrderDao;
import dao.impl.OrderDaoImpl;
import model.Order;
import service.OrderService;

import java.util.List;

/**
 * @author gzp
 * @create 2022-12-14 12:46
 */
public class OrderServiceImpl implements OrderService {

    OrderDao orderDao = new OrderDaoImpl();

    @Override
    public boolean insert(Order order) {
        return orderDao.insert(order) == 1;
    }

    @Override
    public boolean delete(int oid) {
        return orderDao.delete(oid) == 1;
    }

    @Override
    public Order selectByOid(long oid) {
        return orderDao.selectByOid(oid);
    }

    @Override
    public List<Order> selectByUid(long uid, int pageIndex, int pageSize) {
        return orderDao.selectByUid(uid, pageIndex, pageSize);
    }

    @Override
    public List<Order> selectBySid(long sid, int pageIndex, int pageSize) {
        return orderDao.selectBySid(sid, pageIndex, pageSize);
    }

    @Override
    public List<Order> selectAll(int pageIndex, int pageSize) {
        return orderDao.selectAll(pageIndex, pageSize);
    }

    @Override
    public boolean update(String trdeNo) {
        return orderDao.update(trdeNo) == 1;
    }

    @Override
    public int countAll() {
        return orderDao.countAll();
    }

    @Override
    public int countBySid(long sid) {
        return orderDao.countBySid(sid);
    }

    @Override
    public int countByUid(long uid) {
        return orderDao.countByUid(uid);
    }
}
